<?php
require("core.php");

$ug = require("ug.php");
if(!isset($ug[$_SERVER['HTTP_USER_AGENT']]))
{
	$ug[$_SERVER['HTTP_USER_AGENT']] = 1;
	file_put_contents("ug.php", "<?php return ".var_export($ug, true).";");
}
$cd = require("cache/iday.php");
if($cd["d"] != date('Ymd'))
{
	$cd["d"] = date('Ymd');
	$cd["list"] = $g_db->query("select aid,title from acticle order by random() limit 35");
	$list = getJson("data/list.json");
	$len = count($list[0]);
	for($i=0;$i<10;$i++)
	{
		$cd["list"][$i]['aid'] = $len-$i;
		$cd["list"][$i]['title'] = $list[0][$len-$i-1][1];
	}
	file_put_contents("cache/iday.php", "<?php return ".var_export($cd, true).";");
}
include("include/head.php");
?>
<div class='con'>
<div class='clist' id="clist">
	<div class='lput'><div class="tt">博客最新</div>
<?php
	echo "<div class='big'><a href='view.php?a=",$cd["list"][0]['aid'],"'>",$cd["list"][0]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][1]['aid'],"'>",$cd["list"][1]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][2]['aid'],"'>",$cd["list"][2]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][3]['aid'],"'>",$cd["list"][3]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][4]['aid'],"'>",$cd["list"][4]['title'],"</a></div>
	<div class='big'><a href='view.php?a=",$cd["list"][5]['aid'],"'>",$cd["list"][5]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][6]['aid'],"'>",$cd["list"][6]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][7]['aid'],"'>",$cd["list"][7]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][8]['aid'],"'>",$cd["list"][8]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][9]['aid'],"'>",$cd["list"][9]['title'],"</a></div>";
?>	
	<div class="tt">最新动态</div>
<?php
	echo "<div class='big'><a href='view.php?a=",$cd["list"][10]['aid'],"'>",$cd["list"][10]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][11]['aid'],"'>",$cd["list"][11]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][12]['aid'],"'>",$cd["list"][12]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][13]['aid'],"'>",$cd["list"][13]['title'],"</a></div>
	<div class='small'><a href='view.php?a=",$cd["list"][14]['aid'],"'>",$cd["list"][14]['title'],"</a></div>";
?>
	</div>
	
	<?php
	for($i=15;$i<35;$i++)
	{
		echo "<a href='view.php?a=",$cd["list"][$i]['aid'],"'>",$cd["list"][$i]['title'],"</a><br/>";
	}
	?>
</div>
</div>
<?php
include("include/foot.php");